package code07_面向对象.多态;

/**
 * @author 黄衡熙
 * @version 1.0
 * @date 2025年07月21日14:35
 */
public class Person {
    private String name;
    private String gender;
    private int age;

    public void show() {
        System.out.println("父类方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

class Man extends Person {
    private double salary;

    public void show() {
        System.out.println("子类方法");
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public void work() {
        System.out.println("作为一个男人,每天需要996,赚钱养家,一个月赚了" + salary + "元");
    }
}

class WoMan extends Person {
    private int appearance; // 颜值:0-100

    public void show() {
        System.out.println("这是子类WoMan中的方法");
    }

    public void shopping() {
        System.out.println("这是一个只需要貌美如花的女人,每天逛逛街喝喝茶,她的颜值:" + appearance);
    }

    public int getAppearance() {
        return appearance;
    }

    public void setAppearance(int appearance) {
        this.appearance = appearance;
    }
}
